var e = require;
var t = module;
var o = exports;
var n,
    i = o,
    a =
        ((n = function (e, t) {
            return (n =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
                })(e, t);
        }),
        function (e, t) {
            function o() {
                this.constructor = e;
            }
            n(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o()));
        });
Object.defineProperty(i, "__esModule", {value: !0}), (i.SnakeBlockItem = void 0);
var r = (function (e) {
    function t() {
        var t = (null !== e && e.apply(this, arguments)) || this;
        return (t.snakePathMap = new Map()), t;
    }
    return (
        a(t, e),
        (t.prototype.add = function (e, t) {
            if (this.snakePathMap.has(e)) {
                var o = this.snakePathMap.get(e);
                return (o.num += 1), void this.snakePathMap.set(e, o);
            }
            var n = new s();
            (n.num = 1), (n.snakeControl = t), this.snakePathMap.set(e, n);
        }),
        (t.prototype.remove = function (e) {
            if (this.snakePathMap.has(e)) {
                var t = this.snakePathMap.get(e);
                t.num <= 1 ? this.snakePathMap.delete(e) : ((t.num -= 1), this.snakePathMap.set(e, t));
            }
        }),
        (t.prototype.clearPartInfo = function (e) {
            this.snakePathMap.delete(e);
        }),
        (t.prototype.hasBlockEmpty = function () {
            return 0 === this.snakePathMap.size;
        }),
        (t.prototype.getBlockItems = function (e) {
            var t = [];
            return (
                this.snakePathMap.forEach(function (o, n) {
                    n != e && t.push(o);
                }),
                t
            );
        }),
        (t.prototype.getFirstBlockItem = function (e) {
            var t = null;
            return (
                this.snakePathMap.forEach(function (o, n) {
                    if (n != e) return (t = o);
                }),
                t
            );
        }),
        t
    );
})(e("BaseBlockInfo").default);
i.default = r;
var s = function () {};
i.SnakeBlockItem = s;
